<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<p>
    <label class="lbInput">Componentes</label><br>
    <sql:query var="queryComponentes" dataSource="jdbc/dbo_MicrosoftSQLServer">
        SELECT  Componentes.* FROM Componentes
        where id_area=?
        order by desc_componente
        <sql:param value="${param.id_area}"/>
    </sql:query>
    <c:choose>
        <c:when test="${param.checkbox==1}">
            <c:forEach var="componente" items="${queryComponentes.rows}">
                <input type="checkbox" name="id_componente" value="${componente.id_componente}"><label class="lbInput">${componente.desc_componente}</label><br>
            </c:forEach>
        </c:when>
        <c:otherwise>
            <select name="id_componente" id="componente">
                <option value="">Selecione um valor</option>
                <c:forEach var="componente" items="${queryComponentes.rows}">
                    <option value="${componente.id_componente}">${componente.desc_componente}</option>
                </c:forEach>
            </select>
        </c:otherwise>
    </c:choose>

</p>